/*
	atuh:Chunning.Xu
	purpose:include methods for comunication between js and as.
	date:2009-11-25
*/
package com.components.net
{
		
	import flash.external.ExternalInterface;
	
	public class ComunicateJS
	{
		//START
		
		
		//CONSTRUCTOR
		public function ComunicateJS()
		{
			
		}
		
		//Call a js function 
		static public function call(strFuname:String,...paras):*
		{					
			
			var arrParas:Array = [strFuname];
			
			arrParas = arrParas.concat(paras);
									
			return ExternalInterface.call.apply(null,arrParas);
									
		}
		
		//Add a as method wait for calling of js
		static public function addCallback(strFuname:String,funCallback:Function):void
		{
			ExternalInterface.addCallback(strFuname,funCallback);			
		}
		
		
		//END
	}
}